﻿<%@ Page Title="" Language="C#" MasterPageFile="~/HvtAdmin/AdminMuban/PanelMuban.Master" AutoEventWireup="true" CodeBehind="PictureList.aspx.cs" Inherits="HoverTreeWeb.HVTPanel.HPicture.PictureList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HvtHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HoverTreeCPH" runat="server">
    <h3>图片列表</h3>
    所属图集：<asp:Literal runat="server" ID="ltlImageSetTitle"  />
    <br />图集ID：<asp:Literal runat="server" ID="ltlImageSetID" /><br />
    <asp:Repeater runat="server" ID="rptList">
        <HeaderTemplate><table></HeaderTemplate>
        <ItemTemplate><tr><td><a href="PictureAlter.aspx?hvtid=<%#((HoverTree.Model.PictureInfo)Container.DataItem).HvtId.ToString() %>">
            <img  src="<%#((HoverTree.Model.PictureInfo)Container.DataItem).HvtSrc %>" style="width:200px;height:160px;" /></a></td>
            <td>
                <a  href="javascript:HvtSetCover(<%#((HoverTree.Model.PictureInfo)Container.DataItem).HvtId.ToString() %>)" target="_self">设置封面</a>
                <a  href="javascript:HvtGenerate(<%#((HoverTree.Model.PictureInfo)Container.DataItem).HvtId.ToString() %>)" target="_self"> 生成</a>
            </td>
                      </tr></ItemTemplate>
        <FooterTemplate></table></FooterTemplate>
    </asp:Repeater>

    <asp:Literal runat="server" ID="ltlPages" />
    <br /><br />
    <asp:TextBox runat="server" ID="txtHvtConfirm" />
    <asp:Button runat="server" ID="btnGenerateAll" Text="生成全部图片" OnClick="btnGenerateAll_Click" style="height: 21px" />
    <asp:Literal runat="server" ID="ltlTips" />
    <br /><br />
    <script>
        function HvtSetCover(hvtid) {
            if (!confirm("确定设置吗？"))
            { return; }

            $.ajax({
                type: "Post",
                url: "picturelist.aspx/SetCover",
                //方法传参的写法一定要对
                data: "{'hvtid':'"+hvtid+"'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    //返回的数据用data.d获取内容
                    if (data.d == '')
                        alert('设置成功！');
                    else
                        alert(data.d);
                },
                error: function (err) {
                    alert(err);
                }
            });
        }

        function HvtGenerate(hvtid) {

            $.ajax({
                type: "Post",
                url: "picturelist.aspx/HvtGenerate",
                //方法传参的写法一定要对
                data: "{'hvtid':'" + hvtid + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    //返回的数据用data.d获取内容
                    if (data.d == '')
                        alert('生成成功！');
                    else
                        alert(data.d);
                },
                error: function (err) {
                    alert(err);
                }
            });
        }
        </script>
</asp:Content>